<?php
require_once 'buildCurl.php';
$res = json_decode(file_get_contents('php://input'), true);

$session = $res['session'];
$url = "http://211.82.48.36/main/academicInfo";

$myCurl = new MyCurl($url, $session);
$result = $myCurl->getResult();
$httpCode = $myCurl->getHttpCode();

if ($httpCode != 200) {
    $arr = array('err' => 1);
    exit(json_encode($arr));
}

$result = json_decode($result, true);
$arr = array('err' => 0, 'gpa' => $result['0']['gpa']);
exit(json_encode($arr));
